##
## Makefile for zappy in /home/fassi_c//zappy2/zappouet/server
##
## Made by clement fassi
## Login   <fassi_c@epitech.net>
##
## Started on  Wed Jun 29 11:59:47 2011 clement fassi
## Last update Thu Jun 30 13:53:47 2011 clement fassi
##

NAME_S	= serveur
DIR_U	= utils

SRC_S	= ./serveur.c			\
	  ./get_max_fd.c

SRC_U	= $(DIR_U)/list.c		\
	  $(DIR_U)/my_strcat.c		\
	  $(DIR_U)/my_putstr.c		\
	  $(DIR_U)/select_elem.c	\
	  $(DIR_U)/str_to_tab.c		\
	  $(DIR_U)/xfunc.c

OBJ_S	= $(SRC_S:.c=.o)
OBJ_U	= $(SRC_U:.c=.o)

CFLAGS	+= -W -Wall -Wextra -ansi -pedantic -D_GNU_SOURCE
CC	= gcc
RM	= rm -fv

all	: $(NAME_S)
	  $(RM) ./*.o
	  $(RM) utils/*.o

$(NAME_S): $(OBJ_S) $(OBJ_U)
	$(CC) -o $(NAME_S) $(OBJ_S) $(OBJ_U)

.c.o	:
	$(CC) $(CFLAGS) -c $< -o $@

clean	:
	-$(RM) $(OBJ_S) $(OBJ_U)

fclean	: clean
	-$(RM) $(NAME_S)
	-$(RM) ./*.o
	-$(RM) utils/*.o

re	: fclean all